static int in_time;
static int in_desc;
static int in_cdata;
+static int in_cmt;
static int in_gs_type;
static int in_gs_diff;
static int in_gs_terr;
tag_wpt(attr);
} if (strcmp(el, "desc") == 0) {
in_desc++;
+ } if (strcmp(el, "cmt") == 0) {
+ in_cmt++;
} if (strcmp(el, "rtept") == 0) {
in_rte++;
tag_wpt(attr);
wpt_tmp->shortname = xstrdup(cdatastr);
}
if (in_desc && in_wpt) {
+ wpt_tmp->notes = xstrdup(cdatastr);
+ }
+ if (in_cmt && in_wpt) {
wpt_tmp->description = xstrdup(cdatastr);
}
if (in_ele) {
in_name--;
} else if (strcmp(el, "desc") == 0) {
in_desc--;
+ } else if (strcmp(el, "cmt") == 0) {
+ in_cmt--;
} else if (strcmp(el, "ele") == 0) {
in_ele--;
} else if (strcmp(el, "time") == 0) {
* me as a cdata that are fragmented becuae they span a read. Grrr.
*/
if ((in_name && in_wpt) || (in_desc && in_wpt) || (in_ele) ||
+ (in_wpt && in_cmt) ||
(in_wpt && in_gs_type) ||
(in_wpt && in_gs_diff) ||
(in_wpt && in_gs_terr) ||
fprintf(ofd, "<name>%s</name>\n", oname);
}
if (waypointp->description) {
- fprintf(ofd, "<desc>");
+ fprintf(ofd, "<cmt>");
fprintf(ofd, "<![CDATA[%s]]>", waypointp->description);
+ fprintf(ofd, "</cmt>\n");
+ }
+ if (waypointp->notes) {
+ fprintf(ofd, "<desc>");
+ fprintf(ofd, "<![CDATA[%s]]>", waypointp->notes);
fprintf(ofd, "</desc>\n");
+ } else {
+ if (waypointp->description) {
+ fprintf(ofd, "<desc>");
+ fprintf(ofd, "<![CDATA[%s]]>", waypointp->description);
+ fprintf(ofd, "</desc>\n");
+ }
}
if (waypointp->position.altitude.altitude_meters) {
fprintf(ofd, "<ele>\n%f\n</ele>\n",